<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="div">
        <input type="button" value="按钮" v-on:click="add(1,$event)"> <br>
        <a href="http://www.qq.com" id="ab" v-on:click.prevent="di">链接</a>
        <input type="text" v-on:keyup.enter="keyup">
    </div>
</body>
<script>
//    document.getElementById("ab").onclick = function (e) {
//        console.log(e);
//        e.preventDefault();//取消事件的默认行为
//        e.stopPropagation();//阻止事件的传播行为
//    }
 var vue = new Vue({
     el:"#div",
     data:{

     },
     methods:{
         add:function (a,e) {
             console.log(a);
             console.log(e);
         },
         di:function () {
             alert("2");
         },
         keyup:function () {
             console.log("1");
         }
     }
 });

</script>
</html>